@echo off
echo ====================================
echo PDF Splitter Windows Build Script
echo ====================================
echo.

:: Check if Python is installed
python --version >nul 2>&1
if errorlevel 1 (
    echo Error: Python is not installed or not in PATH
    echo Please install Python 3.8 or later from https://python.org
    pause
    exit /b 1
)

:: Check if UV is installed
uv --version >nul 2>&1
if errorlevel 1 (
    echo Installing UV...
    pip install uv
)

:: Install dependencies
echo Installing dependencies...
uv sync

:: Run simple build script
echo Starting build process...
uv run python build_simple.py

echo.
echo ====================================
echo Build process completed!
echo ====================================
echo.
echo Check the 'dist' folder for the executable.
echo.
echo To create an installer:
echo 1. Install Inno Setup from https://jrsoftware.org/isdl.php
echo 2. Run 'uv run python scripts/build_windows.py' to generate ISS file
echo 3. Open the ISS file in Inno Setup and compile
echo.
pause